var _Environment = require('environment');

var _ButtonIds = require('event/buttonid.js');
var BUTTON_DOWN = _ButtonIds.BUTTON_DOWN;
var BUTTON_UP = _ButtonIds.BUTTON_UP;
var BUTTON_MOVE = _ButtonIds.BUTTON_MOVE;
var BUTTON_CANCEL = _ButtonIds.BUTTON_CANCEL;

// ==========================
// EndSwip
// ==========================
function EndSwip(game) {
    this.mGame = game;
    this.mActivetime = _Environment.currentTimeMillis() + 200;
}
EndSwip.prototype.onTouch = function (event) {
    switch (event.state) {
        case BUTTON_DOWN:
            if (_Environment.currentTimeMillis() >= this.mActivetime) {
                this.mGame.setUpdateSpeed(10);
            }
            break;
    }
    return true;
};

module.exports = EndSwip;